import router from '../router/index'

import axios from './axios';
const domain='http://jingda.luckread.cn/api/';
axios.defaults.baseURL = domain;
axios.interceptors.response.use(function (response) { 
  // 重定向到登录页面 
  if (response.data.data == 'no_login'){
    window.localStorage.removeItem('user_name');
    router.replace({ path: '/login'}) 
  }else{
    return response;
  }
})
// //获取验证码
// export const getCode = (params) => axios.post('https://www.rzkeji.com/api/auth/sendVerificationCode', params);
// //获取管理员用户信息
// export const getAdminUserInfo = (params) => axios.get('getAdminUserInfo', {'params':{...params}});
// //登陆
// export const companyPublicizeLogin = (params) => axios.post('companyPublicizeLogin',params);
// //管理员登录
// export const signInUser = (params) => axios.post('signInUser',params);
// //获取用户信息
// export const getUserInfo = (params) => axios.get('https://www.rzkeji.com/api/ucenter/getUserInfo', {'params':{...params}});
// //用户退出
// export const loginOut = () => axios.post('loginOut');

//获取答卷列表
export const getUserAnswerList = (params) => axios.get('admin/sys/getUserAnswerList', {'params':{...params}});
//获取答卷详情
export const getUserQuestionAnswer = (params) => axios.get('admin/sys/getUserQuestionAnswer', {'params':{...params}});
//评分
export const setScore = (params) => axios.post('admin/sys/setScore',params);
//获取排行榜
export const getLeaderBoard = (params) => axios.get('admin/sys/getLeaderBoard', {'params':{...params}});






    
    
    
    
    
    
      
      
      
      
      
      
      
  
    

    
    
